import request from '@/utils/request'

// 修改用户信息
export function saveOrUpdateEduxcloudUser(data) {
  return request({
    url: '/us/user/eduxcloudUser/saveOrUpdateEduxcloudUser',
    method: 'post',
    data
  })
}

// 查询手机号是否被使用
export function checkPhoneNumber(params) {
  return request({
    url: '/us/user/eduxcloudUser/checkPhoneNumber',
    method: 'get',
    params: {phoneNum: params}
  })
}

// 批量创建账号
export function bathCreateAccount(data) {
  return request({
    url: '/us/user/eduxcloudUser/bathCreateAccount',
    method: 'post',
    data
  })
}

// 修改用户信息
export function addMoreUser(data) {
  return request({
    url: '/us/user/eduxcloudUser/addMoreUser',
    method: 'post',
    data
  })
}

// 修改用户组信息
export function updateUserRoles(id, roleIds) {
  return request({
    url: '/us/user/eduxcloudUser/updateUserRoles',
    mathod: 'get',
    params: {id: id, roleIds: roleIds}
  })
}

// 修改用户头像（大图）
export function updateUserAvatar(id, avatar) {
  return request({
    url: '/us/user/eduxcloudUser/updateUserAvatar',
    mathod: 'get',
    params: {id: id, avatar: avatar}
  })
}

// 修改用户密码
export function updatePassword(id, password) {
  return request({
    url: '/us/user/eduxcloudUser/updatePassword',
    mathod: 'get',
    params: {id: id, password: password}
  })
}

export function categoryList(type, tenantId) {
  return request({
    url: '/us/user/eduxcloudUser/categoryList',
    mathod: 'get',
    params: {type: type, tenantId: tenantId}
  })
}

export function courseList(data) {
  return request({
    url: '/us/user/eduxcloudUser/courseList',
    method: 'post',
    data
  })
}

export function getInformationInfo(data) {
  return request({
    url: '/ops/article/getInformationInfo',
    method: 'post',
    data
  })
}

export function courseListByTenantId(tenantId) {
  return request({
    url: '/us/user/eduxcloudUser/courseListByTenantId',
    mathod: 'get',
    params: {tenantId: tenantId}
  })
}

export function getTeacherList(tenantId) {
  return request({
    url: '/ss/sys/teacher/list',
    mathod: 'get',
    params: {tenantId: tenantId}
  })
}
export function getStudentList(tenantId) {
  return request({
    url: '/ss/sys/student/list',
    mathod: 'get',
    params: {tenantId: tenantId}
  })
}

export function coursePackageList(categoryId, tenantId) {
  return request({
    url: '/us/user/eduxcloudUser/coursePackageList',
    mathod: 'get',
    params: {categoryId: categoryId, tenantId: tenantId}
  })
}

export function userLevelList(tenantId) {
  return request({
    url: '/us/user/eduxcloudUser/userLevelList',
    mathod: 'get',
    params: {tenantId: tenantId}
  })
}

export function classRoomCourseList(classRoomId) {
  return request({
    url: '/us/user/eduxcloudUser/classRoomCourseList',
    mathod: 'get',
    params: {classRoomId: classRoomId}
  })
}

export function getCoursePrice(courseIds) {
  return request({
    url: '/us/user/eduxcloudUser/getCoursePrice',
    mathod: 'get',
    params: {courseIds: courseIds}
  })
}

export function getEduxcloudClassRoomPrice(classRoomIds) {
  return request({
    url: '/us/user/eduxcloudUser/getEduxcloudClassRoomPrice',
    mathod: 'get',
    params: {classRoomIds: classRoomIds}
  })
}

// 删除用户
export function deleteUserById(id) {
  return request({
    url: '/us/user/eduxcloudUser/deleteUserById',
    mathod: 'get',
    params: {id: id}
  })
}

// 更新教师推荐状态
export function updateEducloudTeacherPromoted(data) {
  return request({
    url: '/us/user/eduxcloudTeacher/updateEducloudTeacherPromoted',
    method: 'post',
    data
  })
}

// 获得用户管理列表数据
export function getEduxcloudUserPager(data) {
  return request({
    url: '/us/user/eduxcloudUser/getEduxcloudUserPager',
    method: 'post',
    data
  })
}

// 判断账号是否存在
export function checkAccount(params) {
  return request({
    url: '/us/user/eduxcloudUser/checkAccount',
    method: 'get',
    params: {account: params}
  })
}

// 获得用户管理列表字典数据
export function getEduxcloudUserDic(tenantId) {
  return request({
    url: '/us/user/eduxcloudUser/getEduxcloudUserDic',
    method: 'get',
    params: {tenantId: tenantId}
  })
}

export function getAllUserList(data) {
  return request({
    url: '/us/user/eduxcloudUser/getAllUserList',
    method: 'post',
    data
  })
}

// 根据id获得用户信息
export function getEduxcloudUserById(id) {
  return request({
    url: '/us/user/eduxcloudUser/getEduxcloudUserById',
    method: 'get',
    params: {id: id}
  })
}

// 根据nickName获得用户信息
export function checkUserExit(params) {
  return request({
    url: '/us/user/eduxcloudUser/getEduxcloudUserByNickName',
    method: 'get',
    params: {nickName: params}
  })
}

// 获得教师管理列表数据
export function getEduxcloudTeacherPager(data) {
  return request({
    url: '/us/user/eduxcloudTeacher/getEduxcloudTeacherPager',
    method: 'post',
    data
  })
}

// 获得会员管理列表数据
export function getEduxcloudMemberPager(data) {
  return request({
    url: '/us/user/eduxcloudMember/getEduxcloudMemberPager',
    method: 'post',
    data
  })
}

// 添加或修改会员管理列表数据
export function saveOrUpdateMemberUser(data) {
  return request({
    url: '/us/user/eduxcloudMember/saveOrUpdateMemberUser',
    method: 'post',
    data
  })
}

// 删除会员管理列表数据
export function deleteMemberUser(id, userId) {
  return request({
    url: '/us/user/eduxcloudMember/deleteMemberUser',
    method: 'get',
    params: {id: id, userId: userId}
  })
}

// 获得会员操作管理列表数据
export function getVipLevel(params) {
  return request({
    url: '/us/user/eduxcloudMember/getVipLevel',
    method: 'get',
    params
  })
}

// 根据用户id获取会员信息
export function checkMemberExit(params) {
  return request({
    url: '/us/user/eduxcloudMember/getMemberByUserId',
    method: 'get',
    params: {userId: params}
  })
}

// 批量添加会员信息
export function addMoreVip(data) {
  return request({
    url: '/us/user/eduxcloudMember/addMoreVip',
    method: 'post',
    data
  })
}

// 获得登陆日志列表数据
export function getEduxcloudLoginLogPager(data) {
  return request({
    url: '/us/user/eduxcloudLoginLog/getEduxcloudUserPager',
    method: 'post',
    data
  })
}

// 获得详细登陆日志数据
export function findByUserName(data) {
  return request({
    url: '/us/user/eduxcloudLoginLog/getPagerByUserName',
    method: 'post',
    data
  })
}

// 获得用户统计数据列表
export function getLearnTotalPager(data) {
  return request({
    url: '/us/user/learnStatisticsTotal/totalPager',
    method: 'post',
    data
  })
}

// 获得会员操作管理列表数据
export function getEduxcloudMemberOperatePager(data) {
  return request({
    url: '/us/user/eduxcloudMember/getEduxcloudMemberOperatePager',
    method: 'post',
    data
  })
}

// 获得私信管理列表数据
export function getEduxcloudMessagePager(data) {
  return request({
    url: '/us/user/eduxcloudMessage/getEduxcloudMessagePager',
    method: 'post',
    data
  })
}

// 获得实名认证列表数据
export function getEduxcloudUserApprovalPager(data) {
  return request({
    url: '/us/user/eduxcloudUserApproval/getEduxcloudUserApprovalPager',
    method: 'post',
    data
  })
}

// 获得实名认证列表数据
export function updateAuditInfo(data) {
  return request({
    url: '/us/user/eduxcloudUserApproval/updateAuditInfo',
    method: 'post',
    data
  })
}

// 获得当前在线用户列表数据
export function getEduxcloudUserOnLinePager(data) {
  return request({
    url: '/us/user/eduxcloudbizOnline/onlinePager',
    method: 'post',
    data
  })
}

// 获得当前非会员用户信息
export function getIsNotVipUserList(params) {
  return request({
    url: '/us/user/eduxcloudMember/isNotVipUserList',
    method: 'get',
    params: {tenantId: params}
  })
}

// 获取课程监控分析
export function getCoursePreviewData(data) {
  return request({
    url: '/us/user/courseMonitoringAnalysis/getAnalysis',
    method: 'post',
    data
  })
}

// 获取教师/学员监控分析
export function getUserPreviewData(data) {
  return request({
    url: '/us/user/userMonitoringAnalysis/getAnalysis',
    method: 'post',
    data
  })
}

//报名
export function joinClass(data) {
  return request({
    url: '/us/user/eduxcloudUser/joinClass',
    method: 'post',
    data
  })
}
